package servlet;

import bean.Class;
import service.ClassService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @Author : liuchangling
 * @Descrition :
 * @Date： Created in 10:57 下午 2021/6/6
 */
@WebServlet(name = "SelectClassServlet",urlPatterns = "/getClass")
public class SelectClassServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        int classNo=Integer.parseInt(request.getParameter("classNo").trim());
        ClassService classService=new ClassService();
        List<Class> aClass = classService.getClass(classNo);
        request.getSession().setAttribute("classResult",aClass);

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request,response);
    }
}
